#include <GL/glut.h>

#include "../objloader.h"
#include "infantry.h"
#include "../vec3f.h"

Model *_unit;

Infantry::Infantry()
{
	_pos = Vec3f( 0.0f, 0.0f, 0.0f);
	_rot = Vec3f( 0.0f, 1.0f, 0.0f);
	_angle = 0.0f;
	_unit = new Model("../models/infantry/infantry.obj", 0);
	
}

Infantry::Infantry(Vec3f p, Vec3f r, float angle)
{
	_pos = p;
	_rot = r;
	_angle = angle;
	_unit = new Model("../models/infantry/infantry.obj", 0);
}

void Infantry::draw()
{
     
     glPushMatrix();
     
     glTranslatef(_pos.x, _pos.y, _pos.z);
     glRotatef(_angle, _rot.x, _rot.y, _rot.z);
     
     _unit->draw();
     
     glPopMatrix();
     
}    

void Infantry::act()
{
	_angle += 9.0f;
	if(_angle > 360) _angle -= 360;
}
